import 'package:json_annotation/json_annotation.dart';

part 'spare_info.g.dart';

@JsonSerializable()
class SpareInfoModel {

  /// 名称
  String name;

  /// 库存
  int inventory;

  /// 存放位置
  String location;

  SpareInfoModel(
      { required this.name, required this.inventory, required this.location});

  factory SpareInfoModel.fromJson(Map<String, dynamic> json) => _$SpareInfoModelFromJson(json);

  Map<String, dynamic> toJson() => _$SpareInfoModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}